home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / quad / RCS / Quad_PutUns.c,v < prev    next >
Encoding:
Text File  |  1991-03-18  |  1.5 KB  |  76 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     91.03.18.12.21.00;  author kupfer;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Format an unsigned quad and write it to a stream.
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/* 
  27.  * Quad_PutUns.c --
  28.  *
  29.  *    Implemenation of Quad_PutUns library routine.
  30.  *
  31.  * Copyright 1991 Regents of the University of California
  32.  * Permission to use, copy, modify, and distribute this
  33.  * software and its documentation for any purpose and without
  34.  * fee is hereby granted, provided that this copyright
  35.  * notice appears in all copies.  The University of California
  36.  * makes no representations about the suitability of this
  37.  * software for any purpose.  It is provided "as is" without
  38.  * express or implied warranty.
  39.  */
  40.  
  41. #ifndef lint
  42. static char rcsid[] = "$Header: /sprite/lib/forms/RCS/proto.c,v 1.5 91/02/09 13:24:44 ouster Exp $ SPRITE (Berkeley)";
  43. #endif /* not lint */
  44.  
  45. #include <quad.h>
  46.  
  47.  
  48. /*
  49.  *----------------------------------------------------------------------
  50.  *
  51.  * Quad_PutUns --
  52.  *
  53.  *    Format the given unsigned quad and write it to the given stream.
  54.  *
  55.  * Results:
  56.  *    None.
  57.  *
  58.  * Side effects:
  59.  *    None.
  60.  *
  61.  *----------------------------------------------------------------------
  62.  */
  63.  
  64. void
  65. Quad_PutUns(stream, q)
  66.     FILE *stream;
  67.     u_quad q;
  68. {
  69.     if (q.val[QUAD_MOST_SIG] == 0) {
  70.     fprintf(stream, "%lu", q.val[QUAD_LEAST_SIG]);
  71.     } else {
  72.     fprintf(stream, "%.12g", Quad_UnsToDouble(q));
  73.     }
  74. }
  75. @
  76.